package rigidbody;

import geometry.Sphere;

import javax.vecmath.Color3f;
import javax.vecmath.Point3d;

public class SphereRigidBody extends RigidBody
{
    double _radius;
    
    public SphereRigidBody(double mass_, Point3d position_, double radius_)
    {
    	this(mass_, position_, radius_, Sphere.DEFAULT_SPHERE_COLOR);
    }
    
    public SphereRigidBody(double mass_, Point3d position_, double radius_, Color3f color_)
    {
        super(mass_, position_, new Sphere(radius_, color_));
        _radius = radius_;
        initASDF();
        m_initialInertia.m00 = m_mass * _radius * _radius;
        m_initialInertia.m11 = m_mass * _radius * _radius;
        m_initialInertia.m22 = m_mass * _radius * _radius;
        
        // 2/5ths for solid, 2/3rds for hollow
        m_initialInertia.mul(2.0/5.0);
    }
}
